package day13_net.com.itheima.d4_tcp;

import java.io.DataOutputStream;
import java.io.OutputStream;
import java.net.Socket;

public class Client1 {
    public static void main(String[] args) throws Exception{
        Socket socket = new Socket("127.0.0.1", 9999);
        OutputStream os = socket.getOutputStream();
        DataOutputStream dos = new DataOutputStream(os);
        dos.writeInt(12);
        dos.writeUTF("hello,world");
        dos.flush();

        socket.close();
    }
}
